<? 
// instantiate meeting manager
require('../includes/class.main.php');
require_once('../includes/admin.meeting.functions.php');
$manager = new MeetingManager();

// include admin header
include('../template/admin-header.php');

// process form data
if (isset($_POST['submit'])) {
	if ($_POST['submit'] == "Upload") {
		$status = uploadMeetingData();
	}
	if ($_POST['submit'] == "Validate") {
		$status = parseMeetingData();
	}
	
	if ($_POST['submit'] == "Load") {
		$status = loadMeetingData();
	}
}

?>

<div class="left">

	<div class="blurb">
		<b><span class="blue">Warning!!!!</span> </b><br> You are about to
		update all meeting data for the Atlanta area of Alcoholics Anonymous.
		Please take time to review all supplied documentation before
		proceeding. Please also take the time to verify site functionality and
		data integrity after uploading data. Should anything go wrong or any
		questions arise, please contact the developer.<br> <br> Marc Mamane<br>
		Email: <a href="marc@mamane.org">marc@mamane.org</a><br> Cell: (404)
		557-0834
	</div>

	<br>

	<?
	// various status checks
	fileChecks();
	dbChecks();
	?>

</div>

<div class="right">
	<h1>
		<span class="blue">Upload New Meeting Data</span>
	</h1>
	<br> <b>Step 1</b><br>
	<form enctype="multipart/form-data" action="update-meetings.php"
		method="POST">
		<input type="hidden" name="MAX_FILE_SIZE" value="750000" /> Upload
		meeting_data.xls: <br> <input name="xlsdata" type="file" /> <input
			type="submit" name="submit" value="Upload" />
	</form>

	<br> <br> <b>Step 2</b><br>
	<form action="update-meetings.php" method="POST">
		Validate meeting_data.xls: <input type="submit" name="submit"
			value="Validate" />
	</form>

	<br> <br> <b>Step 3</b><br>
	<form action="update-meetings.php" method="POST">
		Load meeting_data.xls: <input type="submit" name="submit" value="Load" />
	</form>

	<?
	if (isset($status)) {
		echo "<br><hr><pre>$status</pre><hr>\n";
	}
	?>
</div>

<?  include('../template/footer.php'); ?>
